home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / lu62 / getattr.c < prev    next >
C/C++ Source or Header  |  1996-07-10  |  4KB  |  139 lines

  1. /**************************************************************/
  2. /**                     GET_ATTRIBUTES                       **/
  3. /**                                                          **/
  4. /**  Function: Handles the requests for information about a  **/
  5. /**            conversation.                                 **/
  6. /**            Information about the conversation resource   **/
  7. /**            is retrieves from the pertinent control       **/
  8. /**            blocks, and then places into the returned     **/
  9. /**            parameters of the GET_ATTRIBUTES verb.        **/
  10. /**                                                          **/
  11. /**  Input:    GET_ATTRIBUTES verb parameters                **/
  12. /**                                                          **/
  13. /**  Output:   GET_ATTRIBUTES verb returnes parameters       **/
  14. /**            containing information about the conversation **/
  15. /**                                                          **/
  16. /**                                                          **/
  17. /** CopyRight 1995. Nicholas Poljakov all rights reserved.   **/
  18. /**                                                          **/
  19. /**************************************************************/
  20. #include <stdio.h>
  21. #include <string.h>
  22. #include <memory.h>
  23. #include <gatt.h>
  24. #include <tcb.h>
  25. #include <mode.h>
  26. #include <lucb.h>
  27. #include <state1.h>
  28. #include <partner.h>
  29. #include <rcb.h>
  30. #include <psp.h>
  31. #include <cma.h>
  32. #include <repass.h>
  33.  
  34. extern struct psp psp_ini;
  35. int sk_r_wt(void *);
  36. int SendBlock(void *, void *);
  37. int setrc(void *, void *);
  38. int sendhsf(void *);
  39. int sendhs(void *);
  40. int sendbm(void *, void *);
  41. int sendat(void *);
  42. int rtsend(void *);
  43. unsigned long rmfmh5(void *, void *);
  44. int recwait(void *);
  45. int rcvru(void *, void *);
  46. int rcvhs(void *, void *, void *, void *);
  47. int ralloc(void *, void *);
  48. int psrm(int, void *, void *);
  49. int ps_conv(int, void *);
  50. int proterr(void *, unsigned long);
  51. int preptrcv(void *, void *);
  52. int post_rcb(void *);
  53. struct repass *postopen(void *);
  54. int phsrec(void *);
  55. int pfmh5(void *);
  56. int opndst(void *);
  57. int obtsess(void *, unsigned char);
  58. int Lrf_handler(void *);
  59. int get_sess(void *, void *);
  60. int fsm_error(unsigned char, void *);
  61. int fsm_conv(unsigned char, unsigned char, void *);
  62. int flush (void *);
  63. int dcp(void *);
  64. int dealloc(void *);
  65. int crtp(void *);
  66. int conv(void *);
  67. int chkparm(void *, void *);
  68. int check_end(unsigned int, void *);
  69. struct rqb *call_appl(void *);
  70. int buffmng(unsigned char, void *, void *, void *, unsigned, unsigned char, unsigned);
  71. unsigned long attltck(void *);
  72. unsigned long attacheck(void *);
  73. char *cgetmem(int, int);
  74. int sendhsf(void *);
  75. int opndst(void *);
  76. int alloc_rcb(void *, void *);
  77. int allocate(void *);
  78. int clsdst(void *);
  79.  
  80. get_attr(pptr)
  81. struct get_attributes *pptr;
  82.  {
  83.   struct lucb *p_lucb;
  84.   struct pnlu *p_partner;
  85.   struct tcb *p_tcb;
  86.   struct rcb *p_rcb;
  87.   struct repass *p_rep;
  88.   struct cma ar;
  89.   char s;
  90.  
  91. #if OS_TYPE == 1
  92. /*********  Trace facility **********/
  93. unsigned int rtype;   /* type of record */
  94. unsigned int pnum;    /* point number */
  95. char pname[8];        /* name of module */
  96. char *drec;          /* record for dump */
  97. int  lenr;            /* record length */
  98.  
  99. rtype = INPROC;
  100. strcpy(pname, "getattr");
  101. pnum = 1;
  102. drec = pptr;
  103. lenr = sizeof(struct get_attributes);
  104. gtf(rtype, pname, pnum, drec, lenr);
  105. /***********************************/
  106. #endif
  107.  
  108.     if (chkparm(pptr, &ar) == -1) {
  109.        return(0);
  110.     }
  111.     p_rcb = ar.p_rcb;
  112.     p_tcb = ar.p_tcb;
  113.  
  114.     p_rep = (struct repass *)pptr;
  115.  
  116.     pptr -> prim_rc = OK;
  117.     pptr -> sec_rc = 0x00000000;
  118.  
  119.     p_lucb = psp_ini.lucb_list_ptr;
  120.     p_partner = p_rcb -> p_partner;
  121.  
  122.     memcpy(pptr -> lu_id, p_lucb -> lu_id, 8);
  123.     pptr -> sync_level = p_rcb -> sync_level;
  124.     memcpy(pptr -> mode_name, p_rcb -> mode_name, 8);
  125.     memcpy(pptr -> own_lu_name, p_lucb -> lu_name, 8);
  126.     memcpy(pptr -> partner_lu_name, p_rcb -> lu_name, 8);
  127.     memcpy(pptr -> init_security, p_tcb -> init_security, 8);
  128.     memcpy(pptr -> sec_profile, p_tcb -> profile, 4);
  129.     pptr -> sec_userid = p_tcb -> userid;
  130.     memcpy(pptr -> conversation_correlator, p_rcb -> conv_correlator, 8);
  131.  
  132.     s ='S';
  133.     p_rcb -> verb_code = Get_attributes;
  134.     p_rcb -> verb_ptr = pptr;
  135.     fsm_conv(s, Get_attributes, p_rcb);
  136.  
  137.     return 0;
  138.  }
  139.